# -*- coding: utf-8 -*-
import datetime
from typing import Union
from pydantic import BaseModel, Field
from typing import List
from .common import YgBase


class UserBase(YgBase):
    id: str
    username: str
    avatar: str | None
    birthday: datetime.date | None
    sex: bool
    email: str | None
    phone: str | None
    org_code: str | None
    activiti_sync: bool
    work_no: str | None
    post: str | None
    telephone: str | None


class UserCreate(UserBase):
    password: str
    status: bool
    del_flag: bool


class UserUpdate(UserBase):
    password: str
    status: bool
    del_flag: bool


class User(UserBase):
    status: bool
    del_flag: bool

    class Config:
        from_attributes = True
        # from_orm = True

